package RW;

import java.util.Scanner;

import org.omg.CORBA.PUBLIC_MEMBER;

public class RenWu {
	//2-3
	public static void main(String[] args) {
		int[] arr = { 16, 25, 9, 90, 23}; 
		for (int i = 0; i < arr.length-1; i++) {
			for (int j = 0; j < arr.length-1-i; j++) {
				if (arr[j]>arr[j+1]) {
					int temp=arr[j];
					arr[j]=arr[j+1];
					arr[j+1]=temp;
				}
			}
		}
		for (int j : arr) {
			System.out.print(j+"\t");
		}
		//2-1
		Scanner sc=new Scanner(System.in);
		System.out.println("请输入班级人数");
		int num =sc.nextInt();
		int[] scores=new int[num];
	    for (int i = 0; i < scores.length; i++) {
	    	System.out.println("第"+(i+1)+"个学员成绩：");
	    	scores[i]=sc.nextInt();
		}
	    double sum=0;
		for (int j = 0; j < scores.length; j++) {
			sum +=scores[j];
		}
		System.out.println("平均成绩是"+(sum/scores.length));
		//2-2
		int[] scores1= {90,88,78,90,86,95,98,72};
		int max=scores1[0];
		for (int j = 0; j < scores1.length; j++) {
			if (max<scores1[j]) {
				max=scores1[j];
			}
		}
		System.out.println("最高分为"+max);
	}
}
